const Koa = require('koa');
const app = new Koa();
const serve = require('koa-static');
const koaBody = require('koa-body');


const registerRouter = require('./routers')
//静态资源
app.use(serve(__dirname + '/public', {
	extensions: ['/']
}));
//
app.use(koaBody({
	multipart: true,
	formidable: {
		maxFileSize: 20000 * 1024 * 1024 // 设置上传文件大小最大限制，默认2M
	}
}));
//接口路由
app.use(registerRouter())
module.exports = app;